home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #include "CredSection.h"
-
- void CredSection::setLMargin(int lmargin)
- {
- lMargin = lmargin;
- }
-
- void CredSection::setRMargin(int rmargin)
- {
- rMargin = rmargin;
- }
-
-
- CredImage::CredImage(int xoffset, int yoffset, int xsize, int ysize,
- ulong *buf)
- {
- credCnt = 0;
- size = ysize;
- spacing = 1;
- xoff = xoffset;
- yoff = yoffset;
- totalCredHeight += size + yoff;
- image[credCnt].xpos = 0;
- image[credCnt].width = xsize;
- image[credCnt].height = ysize;
- image[credCnt].imgBuf = buf;
- }
-
- CredFont::CredFont(char *fFamily, int fsize, long fcolor,
- char *fjust, float fangle, float fspacing)
- {
- fontFamily = new char[strlen(fFamily) + 1];
- strncpy(fontFamily, fFamily, strlen(fFamily) + 1);
- fontJust = new char[strlen(fjust) + 1];
- strncpy(fontJust, fjust, strlen(fjust) + 1);
- fontColor = fcolor;
- size = fsize;
- fontAngle = fangle;
- spacing = fspacing;
- credCnt = 0;
- fontID = credSectCnt;
- xoff = 0;
- yoff = 0;
- }
-
- void CredFont::addStr(char *str)
- {
- credStr[credCnt] = new char[strlen(str) + 1];
- strncpy(credStr[credCnt], str, strlen(str) + 1);
- credCnt++;
- totalCredHeight += (ulong)(size * spacing);
- }
-
- char *CredFont::getStr(int cur)
- {
- return( credStr[cur] );
- }
-
- void CredFont::loadFontEnv()
- {
- wfm_makefontmat(mat, fontAngle, size);
- wfm_makefont(fontID, fontFamily, mat, 0, 0);
- wfm_font(fontID);
- wfm_getfontinfo(fontID, &finfo);
- }
-
- int CredSection::credSectCnt = 0;
- ulong CredSection::totalCredHeight = 0;
-